package com.chb.microservice.provider.feign;

import java.util.List;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.cbh.api.model.ApiResult;
import com.chb.microservice.provider.model.InsuranceCompany;


@FeignClient(name = "cbh-general-rest")
public interface InsuranceCompanyFeignClient {

	/**
	 * 新增保险公司
	 * 
	 * @param icId
	 * @param icCode
	 * @param icName
	 * @param icDetail
	 * @param icLogo
	 * @return
	 */
	@RequestMapping(value = "/sign/v3/insuranceCompanys", method = RequestMethod.POST, produces = "application/json")
	public ApiResult<String> save(@RequestParam(value = "icId",required = false) String icId,
			@RequestParam(value = "icCode",required = true) String icCode, @RequestParam(value = "icName",required = true) String icName,
			@RequestParam(value = "icDetail",required = true) String icDetail, @RequestParam(value = "icLogo",required = true) String icLogo);

	/**
	 * 根据Code获取保险公司信息
	 * 
	 * @param icCode
	 * @return
	 */
	@RequestMapping(value = "/sign/v3/insuranceCompanys/code/{code}", method = RequestMethod.GET, produces = "application/json")
	public ApiResult<InsuranceCompany> getByIcCode(@PathVariable("code") String code);

	/**
	 * 根据ID获取保险公司信息
	 * 
	 * @param id
	 * @return
	 */
	@RequestMapping(value = "/sign/v3/insuranceCompanys/id/{id}", method = RequestMethod.GET, produces = "application/json")
	public ApiResult<InsuranceCompany> getByIcId(@PathVariable("id") String id);

	/**
	 * 根据ID删除保险公司信息
	 * 
	 * @param icId
	 * @return
	 */
	@RequestMapping(value = "/sign/v3/insuranceCompanys/{id}", method = RequestMethod.DELETE, produces = "application/json")
	public ApiResult<Boolean> deleteByIcId(@PathVariable("id") String id);

	/**
	 * 获取全部保险公司信息
	 * 
	 * @return
	 */
	@RequestMapping(value = "/sign/v3/insuranceCompanys", method = RequestMethod.GET, produces = "application/json")
	public ApiResult<List<InsuranceCompany>> getAll();

}
